clear classes

Exp = ET_PTB_BLOCK_RANDOMIZED();

% Resolution
%--------------------------------------------------------------------------
Exp.scn.res = 3;  % 3 = MEG room, 6 = eyetracker room

% Screen size
%--------------------------------------------------------------------------
Exp.scn.w = 1024;
Exp.scn.h = 768;
Exp.scn.wcm  = 38.5;
Exp.scn.hcm = 29.5;

% Exp.scn.w = 1600;
% Exp.scn.h = 1200;
% Exp.scn.wcm  = 40.8;
% Exp.scn.hcm = 30.8;

% Exp.scn.w = 1920;
% Exp.scn.h = 1200;
% Exp.scn.wcm  = 47;
% Exp.scn.hcm = 30;

Exp.scn.mon = 0;

% Amplitud in screen units
%--------------------------------------------------------------------------
Exp.fix.x = -.75;

% Speed in degrees per second when the stimulus crosses the center
%--------------------------------------------------------------------------
% The number of trials should be divisible by the number of speeds.
v              = [22];
speeds         = (360./v) * ((Exp.scn.wcm/2)*abs(Exp.fix.x)*Exp.refresh_rate)/Exp.view_dist;
Exp.FpClearn   = speeds;

% Noise levels in the blocks
%--------------------------------------------------------------------------
Exp.noise_input = [0,exp(-0.5)];

% Number of trials befor a pause
%--------------------------------------------------------------------------
Exp.pauses = 8;

% Size of stimuli
%--------------------------------------------------------------------------
Exp.stim.size = 10;

% Prepare experiment
%--------------------------------------------------------------------------
% num_trials and num_blocks are now protected properties, meaning this that
% you are not allowed to set them directly in order to avoid weird errors.
% Now you should set them though the functions prepareBlocks and
% prepareTrials. Their parameters are just the number of blocks and trials.
% Blocks should always specified first that trials.

% The number of trials should be divisible by the number of speeds.

Exp.prepareBlocks(20)
Exp.prepareTrials(4)
Exp.prepareFixation()

% Size and position of the occluder.
%--------------------------------------------------------------------------
Exp.prepareOccluder(Exp.scn.w*abs(Exp.fix.x)*(2/5),-Exp.scn.w*abs(Exp.fix.x)*(1/5));
Exp.prepareSpeeds()
Exp.prepareJump()
Exp.prepareNoise();

% Define stimuli random start
%--------------------------------------------------------------------------
% In this case all trials use a different seed. If you want to set the same
% seed  for all trial uncomment the following line

%Exp.seeds_input = 1239092130912;
Exp.prepareSeeds();

% Stimuli function
%--------------------------------------------------------------------------
% The non-condition is set up when the parameter Exp.noise_input is set up
% to zero;

Exp.stimuli = inline('randomSinusWalk(x,f,s,seed)','x','f','s','seed');

% Turn eye link & MEG on
%--------------------------------------------------------------------------
Exp.EyeLink = 0;
Exp.MEG = 0;

try 
    Exp.runScreen()
catch Err
    Exp.exit(Err)
end

